modemmanager: change to configuration option disable_modem
authorChristian Korber <[email protected]>
Fri, 27 Jun 2025 06:48:55 +0000 (08:48 +0200)
committerFlorian Eckert <[email protected]>
Tue, 8 Jul 2025 05:55:17 +0000 (07:55 +0200)
This commit sets default of `disable_modem` to 1 and disconnects modem.
If set otherwise it keeps the modem connected.

Signed-off-by: Christian Korber <[email protected]>
net/modemmanager/Makefile
net/modemmanager/files/lib/netifd/proto/modemmanager.sh
net/modemmanager/files/usr/lib/ModemManager/connection.d/10-report-down

index 9cbd4bfca126b60f1c98fdd65062497bb62366ed..1ae1ef8ad9d85140ddff4df0d1a6ad3b6362bf5a 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=modemmanager
 PKG_VERSION:=1.24.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
index f0e0551e479240c38467935dae6d941074395c14..0444ba842d22f728670ca33a984f64019f3414c6 100644 (file)
@@ -877,14 +877,11 @@ proto_modemmanager_teardown() {
        mmcli --modem="${device}" --simple-disconnect ||
                proto_notify_error "${interface}" DISCONNECT_FAILED
 
-       # reading variable from var state which was set in
-       # '/usr/lib/ModemManager/connection.d/10-report-down'
-       # because of a reconnect event.
-       # The modem therefore does not need to be disabled.
-       local disable="$(uci_get_state network "$interface" disable_modem "1")"
+       # Variable is set to '1' if modem should be disabled on ifdown,
+       # otherwise it stays connected.
+       local disable="$(uci_get network "$interface" disable_modem "1")"
        if [ "${disable}" -eq 0 ]; then
                echo "Skipping modem disable"
-               uci_revert_state network "${interface}" disable_modem
        else
                mmcli --modem="${device}" --disable
        fi
index 9c0484d6ed645a9dac9498e861694fad1e65631f..b8feb267790728aabd65afe51472d55a93f9d0c9 100644 (file)
@@ -32,7 +32,6 @@ IFUP=$(ifstatus "${CFG}" | jsonfilter -e "@.up")
 
 [ "${IFUP}" = "true" ] && {
        mm_log "info" "Reconnecting '${CFG}' on '${STATE}' event"
-       uci_toggle_state network "${CFG}" disable_modem "0"
        ubus call network.interface down "{ 'interface': '${CFG}'}"
        ubus call network.interface up "{ 'interface': '${CFG}'}"
 }